From: Florian Müllner Date: Fri, 26 Jul 2019 00:38:49 +0000 (+0200) Subject: screenShield: Stop using custom transition X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~59 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5d6db923b7a5763293e088037f81099610d7bcc4;p=gnome-shell.git screenShield: Stop using custom transition For animating the arrows on the screenshield, we currently use a custom transition function that tweens the opacity from 0 to maxOpacity in the first half of the animation, and from maxOpacity back to 0 in the second half. This doesn't easily translate to Clutter's own animation framework, so replace the custom transition with two consecutive tweens which do. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index a7c5afdaf..552ca4c3d 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -5,7 +5,6 @@ const { AccountsService, Clutter, Cogl, Gio, GLib, const Cairo = imports.cairo; const Mainloop = imports.mainloop; const Signals = imports.signals; -const TweenerEquations = imports.tweener.equations; const Background = imports.ui.background; const GnomeSession = imports.misc.gnomeSession; @@ -736,14 +735,16 @@ var ScreenShield = class { for (let i = 0; i < arrows.length; i++) { arrows[i].opacity = 0; Tweener.addTween(arrows[i], - { opacity: 0, + { opacity: maxOpacity, delay: (unitaryDelay * (N_ARROWS - (i + 1))) / 1000, - time: ARROW_ANIMATION_TIME / 1000, - transition(t, b, c, d) { - if (t < d / 2) - return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2); - else - return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, -maxOpacity, d / 2); + time: ARROW_ANIMATION_TIME / (2 * 1000), + transition: 'easeOutQuad', + onComplete: () => { + Tweener.addTween(arrors[i], { + opacity: 0, + time: ARROW_ANIMATION_TIME / (2 * 1000), + transition: 'easeInQuad' + }); } }); }